<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

    <title>会员列表</title>

    <link href="{$smarty.const.ADMIN_CSS_URL}mine.css" type="text/css" rel="stylesheet" />
</head>
<body>
<style>
    .tr_color{ background-color: #9F88FF }
</style>
<div class="div_head">
            <span>
                <span style="float: left;">当前位置是：权限管理-》权限列表</span>
                <span style="float: right; margin-right: 8px; font-weight: bold;">
                    <a style="text-decoration: none;" href="{$smarty.const.__MODULE__}/Goods/add" target="right">【添加权限】</a>
                </span>
            </span>
</div>
<div></div>
<div class="div_search">
            <span>
                <form action="#" method="get">
                    品牌<select name="s_product_mark" style="width: 100px;">
                    <option selected="selected" value="0">请选择</option>
                    <option value="1">苹果apple</option>
                </select>
                    <input value="查询" type="submit" />
                </form>
            </span>
</div>
<div style="font-size: 13px; margin: 10px 5px;">
    <table class="table_a" border="1" width="100%">

        <tbody><tr style="font-weight: bold;">
            <td>序号</td>
            <td>角色名称</td>
            <td align="center" colspan="3">操作</td>
        </tr>
        {foreach $info as $k => $v}
        <tr id="product1">
            <td>{$v@iteration}</td>
            <td>{$v.role_name}</td>
            <td><a href="{$smarty.const.__CONTROLLER__}/distribute/id/{$v.role_id}">分配权限</a></td>
            <td><a href="{$smarty.const.__CONTROLLER__}/update/id/{$v.role_id}">修改</a></td>
            <td><a href="javascript:;" onclick="delete_good({$v.role_id})">删除</a></td>
        </tr>
        {/foreach}
        <tr>
            <td colspan="20" style="text-align: center;">
                {$nav}
            </td>
        </tr>
        </tbody>
    </table>
</div>
</body>
</html>
<script type="text/javascript">
    function delete_good(id){
        if(confirm('您确定要删除吗!!!操作不可逆!!')){
            var xhr = new XMLHttpRequest();
            xhr.open("GET", "{$smarty.const.__CONTROLLER__}/delete/id/"+id, true);
//            xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
            xhr.onreadystatechange = function(){
                var XMLHttpReq = xhr;
                if (XMLHttpReq.readyState == 4) {
                    if (XMLHttpReq.status == 200) {
                        var text = XMLHttpReq.responseText;
                        location.reload();
                    }
                }
            };
            xhr.send();
        }
    }
</script>